From: David Sn Date: Sat, 16 Dec 2017 01:39:35 +0000 (+0000) Subject: Fix tooltip accessibility for screen readers X-Git-Tag: 1.31.0-rc.0~1179^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=cb401293c5fac3ab94a6909c9928fbea62ccad6b;p=lhc%2Fweb%2Fwiklou.git Fix tooltip accessibility for screen readers By adding an additional aria-label attribute to the tooltip, we can ensure that every tooltip will be accessible for accessibility tools like screen readers. Works with Echo extension, but I am not sure if there are extensions who are using the original-title attribute. Tested with ChromeVox on Chrome 62.0.3202.94. Bug: T54711 Change-Id: I19500c4e8ccbdcb8288b9c2299a29b3f8a31639d --- diff --git a/includes/htmlform/fields/HTMLCheckMatrix.php b/includes/htmlform/fields/HTMLCheckMatrix.php index dd4e707ee5..df44626a3d 100644 --- a/includes/htmlform/fields/HTMLCheckMatrix.php +++ b/includes/htmlform/fields/HTMLCheckMatrix.php @@ -106,6 +106,7 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { $tooltipAttribs = [ 'class' => "mw-htmlform-tooltip $tooltipClass", 'title' => $this->mParams['tooltips'][$rowLabel], + 'aria-label' => $this->mParams['tooltips'][$rowLabel] ]; $rowLabel .= ' ' . Html::element( 'span', $tooltipAttribs, '' ); }